<template>
	<view>
		<mp-html :content="entity" v-if="entity"></mp-html>
		<g-empty v-else></g-empty>
	</view>
</template>

<script>
	
	export default {
		data() {
			return {
				goodsCd: null,
				goodsType: null,
				entity: null,
				headline: ['恒量商品','认证商品']
			}
		},
		onLoad(options) {
			uni.setNavigationBarTitle({
			　　title: options.type == 10 ? this.headline[0] : this.headline[1]
			})
			this.goodsCd = options.goodsCd;
			this.goodsType = options.type;
			this.getRequest();
		},
		methods: {
			getRequest () {
				this.$api.showLoading()
				return this.$api.globalUtil.requestAjax({
					url: '/GoodsApi/goodsDescription',
					method: 'POST',
					data: {
						goodsCd: this.goodsCd,
						goodsType: this.goodsType
					},
					success: (res) => {
						if (!res.data.success) return this.$api.msg(res.data.msg || '获取失败');
						this.entity = res.data.response;
					},
					complate: () => this.$api.hideLoading()
				});
			}
		}
	}
</script>

<style>

</style>
